<template>
	<view class="nav">
		<view class="title">
			<text>{{ title }}</text>
		</view>
		<view class="right" v-if="navs">
			<text v-for="(item, key) in navs" :key="key" @tap="go(item.url)">{{ item.text }}</text>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		title: {
			type: String,
			default: ''
		},
		navs: {
			type: Array,
			default: null
		}
	},
	data() {
		return {};
	},
	methods: {
		go(url) {
			uni.navigateTo({
				url: url
			});
		}
	}
};
</script>

<style lang="scss">
.nav {
	width: 100%;
	height: 80upx;
	font-size: $uni-font-size-base;
	color: $uni-text-color;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20upx;
	box-sizing: border-box;
	.title {
		color: #f34b32;
		font-weight: 700;
		padding-left: 20upx;
		border-left: 4upx solid #f34b32;
	}
	.right {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		color: #333;
		text {
			margin-left: 30upx;
			color: $uni-text-color;
			font-size: $uni-font-size-base;
		}
	}
}
</style>
